package com.itheima.datastream;

import java.io.DataOutputStream;
import java.io.FileOutputStream;

public class Test1 {

    public static void main(String[] args) {

        //特殊数据流

        try (
                //允许把数据和类型一起写出去
                DataOutputStream dos = new DataOutputStream(new FileOutputStream("io\\src\\data.txt"));
        ) {
            dos.writeInt(100);
            dos.writeDouble(3.14);
            dos.writeBoolean(true);
            dos.writeChar('a');
            dos.writeUTF("hello");

        } catch (Exception e) {
            e.printStackTrace();
        }

    }
}
